package org.dtrd.modules.control.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dtrd.modules.control.entity.po.DtrdEntRdSigninTarget;

import java.util.Date;

@ApiModel("控制目标信息")
@Data
public class TargetInfo {

    @ApiModelProperty("控制目标id")
    private Integer dataId;

    @ApiModelProperty(value = "控制目标名称", required = true)
    private String targetName;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "开始日期")
    private Date startDate;

    @ApiModelProperty(value = "结束日期")
    private Date endDate;

    @ApiModelProperty("使用状态 1-使用中, 0-未使用")
    private Integer currentStatus;

    public TargetInfo parseFromPo(DtrdEntRdSigninTarget po) {
        this.setDataId(po.getDataId());
        this.setTargetName(po.getTargetName());
        this.setStartDate(po.getStartDate());
        this.setEndDate(po.getEndDate());
        this.setCreateTime(po.getCreateTime());
        this.setCurrentStatus(po.getCurrentStatus());
        return this;
    }
}
